package util

import (
	"sync"
)

var mutex sync.Mutex
var pool = map[string]*sync.Mutex{}

func Acquire(key string) *sync.Mutex {
	mutex.Lock()
	if pool[key] == nil {
		pool[key] = &sync.Mutex{}
	}
	mutex.Unlock()

	return pool[key]
}
